using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace RBAC.Domain.SalesManage
{
    /// <summary>
    /// 开单物料信息
    /// </summary>
    [Table("BillingMaterials")]
    public class BillingMaterials : BaseEntity
    {
        /// <summary>
        /// 销售订单号
        /// </summary>
        [StringLength(50)]
        public string? OrderNumber { get; set; }

        /// <summary>
        /// 物料编码
        /// </summary>
        [StringLength(50)]
        public string? MaterialCode { get; set; }

        /// <summary>
        /// 物料名称
        /// </summary>
        [StringLength(100)]
        public string? MaterialName { get; set; }



        /// <summary>
        /// 主计量
        /// </summary>
        [StringLength(20)]
        public string? Unit { get; set; }

        /// <summary>
        /// 数量
        /// </summary>
        public int? Quantity { get; set; }

        /// <summary>
        /// 单价
        /// </summary>
        public decimal? UnitPrice { get; set; }

        /// <summary>
        /// 金额
        /// </summary>
        public decimal? Amount { get; set; }

        /// <summary>
        /// 开票名称
        /// </summary>
        [StringLength(100)]
        public string? InvoiceName { get; set; }

        /// <summary>
        /// 备注
        /// </summary>
        [StringLength(500)]
        public string? Remarks { get; set; }

        /// <summary>
        /// 关联的开票单ID 
        /// </summary>
        public long? BillingAccountingId { get; set; }

        /// <summary>
        /// 关联的开票通知单
        /// </summary>
        [ForeignKey("BillingAccountingId")]
        public virtual BillingAccounting? BillingAccounting { get; set; }
    }
}
